$(window).load(function () {
    $('#btnlogin').click(function () {
        var username = $("#username").val();
        var password = $("#password").val();
        var url = $("#postUrl").val();
        var jumpUrl = $("#jumpUrl").val();
        var json = {
            "username": username,
            "password": password
        };
        var successFunction = function (data) {
            if (data.status == 200) {
                alert("登录成功");
                window.location.href = jumpUrl;
            } else if (data.status == -1) {
                alert(data.info);
            }
        };
        var errorFunction = function () {

        };
        $.ajax({
            url: url,
            data: json,
            type: "post",
            error: errorFunction,
            success: successFunction
        });
    });
});